
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<script language="JavaScript">    	
	    function checkIt() {
			var userinput = document.update;
	       /*
	        if(!userinput.passwd.value || !userinput.passwd_re.value) {
	            alert("비밀번호를 입력하세요");
	            return false;
	        }
	       */
	        if(userinput.passwd.value != userinput.passwd_re.value)
	        {
	            alert("비밀번호를 동일하게 입력하세요");
	            return false;
	        }	

	        if(!userinput.name.value) {
	            alert("사용자 이름을 입력하세요");
	            return false;
	        }
	        if(!userinput.email1.value || !userinput.email2.value) {
	            alert("이메일 을 입력하세요");
	            return false;
	        }
	        if(!userinput.phone1.value || !userinput.phone2.value || !userinput.phone3.value) {
	            alert("연락처 를 입력하세요");
	            return false;
	        }
	    }
</script>
	    
<div id="main" class="site-main">
	<div class="full-container">
		<div id="primary" class="content-area">
			<div id="content" class="site-content" role="main">
				<div class="entry-content">
					<div class="panel-grid" id="pg-home-0">
					<center>
					<form name="update" action="updateUser.html" method="post" onsubmit="return checkIt()">				
						<input type="hidden" name="passwd1" value="${loginUser.passwd }" />			
						<hr>
						<B>아이디</B><br><br>
						<input type="text" name="id" value="${loginUser.id }" readonly size="30" />
						<br><br>
						
						<B>비밀번호</B><br><br>
						<input type="password" name="passwd" maxlength="20" size="30" placeholder="변경시에만 입력하여 주십시오" />
						<br><br>
						
						<B>비밀번호 확인</B><br><br>
						<input type="password" name="passwd_re" maxlength="20" size="30" placeholder="비밀번호를 다시 입력하십시오" />
						<br><br>
						
						<B>이름</B><br><br>
						<input type="text" name="name" value="${loginUser.name }" maxlength="15" size="30" />
						<br><br>
						
						<B>이메일</B><br><br>
						<input type="text" name="email1" maxlength="15" value="${email1 }" size="15" />&nbsp;@&nbsp;<input type="text" name="email2" value="${email2 }" maxlength="15" size="15"/>
						<br><br>
						
						<B>휴대폰</B><br><br>
						<input type="text" name="phone1" value="${phone1 }" maxlength="3" size="7" />&nbsp;-&nbsp;<input type="text" name="phone2" value="${phone2 }" maxlength="4" size="7" />&nbsp;-&nbsp;<input type="text" name="phone3" value="${phone3 }" maxlength="4" size="7" />
						<br><br>
						
						<c:if test="${loginUser.favorite == '0' }">
							<c:set var="check0" value="checked" />
						</c:if>
						<c:if test="${loginUser.favorite == '2' }">
							<c:set var="check2" value="checked" />
						</c:if>
						<c:if test="${loginUser.favorite == '3' }">
							<c:set var="check3" value="checked" />
						</c:if>
						<c:if test="${loginUser.favorite == '4'}">
							<c:set var="check4" value="checked" />
						</c:if>
						<c:if test="${loginUser.favorite == '5' } ">
							<c:set var="check5" value="checked" />
						</c:if>
						<c:if test="${loginUser.favorite == '6' } ">
							<c:set var="check6" value="checked" />
						</c:if>
						<c:if test="${loginUser.favorite == '7' } ">
							<c:set var="check7" value="checked" />
						</c:if>
						
						<b>선호 분야</b><br><br>
						<input type=radio name="favorite" value='0' ${check0 }>웹/앱 개발자 &emsp;
						<input type=radio name="favorite" value='2' ${check2 }>웹 개발자 &emsp;
						<input type=radio name="favorite" value='3' ${check3 }>앱 개발자 &emsp;
						<input type=radio name="favorite" value='4' ${check4 }>네트워크 관리자 &emsp;
						<input type=radio name="favorite" value='5' ${check5 }>서버 관리자 &emsp;
						<input type=radio name="favorite" value='6' ${check6 }>보안 전문가 &emsp;
						<input type=radio name="favorite" value='7' ${check7 }>DB 관리자
						<br>
						<br>
						<input type = "submit" value="수정"/>&emsp;<input type="button" value="삭제" onclick="location.href='moveDeleteForm.html'"/>
					</form>
					</center>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

